#ifndef OPENGL_SHADER_H
#define OPENGL_SHADER_H
#include "Shader.h"
#include <glm/glm.hpp>
typedef unsigned int GLenum;
namespace HS {

	class GLShader : public Shader
	{
	public:
		virtual ~GLShader();
		GLShader(const std::string& name, const std::string& vert, const std::string& frag);
		GLShader(const std::string& path);
		virtual void Bind() const override;
		virtual void Unbind() const override;
		virtual const std::string& GetName() const override { return m_Name; }

	    void SetInt(const std::string& name, int value);
	    void SetIntArray(const std::string& name, int* values, uint32_t count);
	    void SetFloat(const std::string& name, float value) ;
	    void SetFloat2(const std::string& name, const glm::vec2& value) ;
	    void SetFloat3(const std::string& name, const glm::vec3& value) ;
		void SetFloat4(const std::string& name, const glm::vec4& value);
		void SetMat4(const std::string& name, const glm::mat4& value);
	private:
		void Compile(const std::unordered_map<GLenum, std::string>& shaderSources);
		std::string ReadFile(const std::string& filepath);
		std::unordered_map<GLenum, std::string> PreProcess(const std::string& source);
	private:
		unsigned int m_handle;
		std::string m_Name;
	};
}
#endif // !OPENGL_SHADER_H
